package net.ufrog.common;

/**
 * 应用
 * 
 * @author ultrafrog
 * @version 1.0, 2013-9-26
 * @since 1.0
 */
public abstract class App {
	
	
	private static String abbbb;

	/** 当前线程环境 */
	private static ThreadLocal<App> current = new ThreadLocal<App>();
	
	/**
	 * 获取当前线程
	 * 
	 * @return
	 */
	public static App current() {
		return current.get();
	}
	
	/**
	 * 获取当前线程
	 * 
	 * @param requiredType
	 * @return
	 */
	@SuppressWarnings("unchecked")
	public static <T extends App> T current(Class<T> requiredType) {
		return (T) current();
	}
	
	/**
	 * 设置当前线程
	 * 
	 * @param context
	 */
	public static void set(App context) {
		current.set(context);
	}
}
